|
LM ADD LIGHT MAP OBJECT
This command adds a DarkBasic object to be light mapped, this can be the same object that has been added as a collision object to provide self shadowing.
LM Add Light Map Object Object Number LM Add Light Map Object Object Number, Base Stage LM Add Light Map Object Object Number, Base Stage, Dynamic Light Mode
Object Number
The id of the object you want to light map.
Base Stage
The id of the stage where the base texture is currently located, if not 0. (default is 0)
Dynamic Light Mode
1 if the light map should allow dynamic lighting to effect the object, 0 if not. (default is 0).
This command does not return a value.
Adding an object as a light map object does not automatically add it as a collision object, you should do this separately. The object should have at least one texture stage, with the base texture in stage 0. If your object has the base texture in a different stage you can use the Base Texture parameter to inform the light mapper of this. The light mapper will create a stage 1 (if it does not already exist), move the base texture into this stage 1 and then create the light map in stage 0. This is to allow the lightmap to be modified by the diffuse colour from dynamic lights before being multiplied by the base texture. If the object contains more than stage 0 and stage 1 the extra stages will be disabled. You can change and re-enable these later using the Set Blend Mapping On command in DarkBasic. When the Dynamic Light Mode parameter is set to 1 the light map will be added to the diffuse colour from normal lights in DarkBasic, this allows you to have dynamic lights that brighten the light map to reveal the base texture. Dynamic lights will not cast shadows.
|